# 开机导览翻页
steps = [{
    content: APPT.step(classes: "step step1", src: "img/start-guide/step1.png", step1: "step1 active")
}, {
    content: APPT.step(classes: "step step2", src: "img/start-guide/step2.png", step2: "step2 active")
}, {
    content: APPT.step(classes: "step step3", src: "img/start-guide/step3.png", step3: "step3 active")
}, {
    content: APPT.step(classes: "step step4", src: "img/start-guide/step4.png", step4: "step4 active", isLast: true)
}];

islider = new iSlider({
    dom: document.getElementsByClassName('start-guide')[0],
    type: 'dom',
    data: steps,
    duration: 100000000,
    isVertical: false,
    isLooping: false,
    isAutoplay: false,
    isOverspread: true,
    isDebug: true,
    isAutoplay: true
});

$('.start-guide').on 'touchstart', '.btn-start', ->
    $('.start-guide').velocity top: '-100%', {
        duration: 800,
        easing: 'easeInOutSine',
        complete: ->
            $(this).remove()
    }

isAnimating = false
APP.jsClick $('.main .header'), true, ->
    return if isAnimating
    $search = $('.search')
    searchX = ['-100%', 0]
    mainX = [0, '90%']
    if $search.hasClass 'active'
        $search.removeClass 'active'
        searchX.reverse()
        mainX.reverse()
    else
        $search.addClass 'active'
    isAnimating = true
    $search.velocity translateX: searchX, {duration: 800}
    $('.main').velocity translateX: mainX, {duration: 800, complete: -> isAnimating = false}